package com.jason.base;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * author sj
 */

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public abstract class BaseModel implements Serializable{

    @JsonSerialize(using=ToStringSerializer.class)
    @TableId(value = "id", type = IdType.ID_WORKER)
    private Long id;

    @TableField("deleted_flag")
    @TableLogic
    private Integer deletedFLag = 0;

    @TableField("remark")
    private String remark;

    @TableField("created_by")
    private Long createdBy;

    @TableField("created_time")
    private Date createdTime;

    @TableField("updated_by")
    private Long updatedBy;

    @TableField("updated_time")
    private Date updatedTime;
    @TableField(exist = false)
    private int current;

    @TableField(exist = false)
    private int size;

    @TableField(exist = false)
    private String orderByField;

    @TableField(exist = false)
    private boolean asc = true;

}
